# Creates a binary package (containing the zencat_sqlite.dll and the xmp documentation)

if [ "$1" == "" ]; then
	echo "Usage: create_zip.sh <version number>";
	echo " e.g.  create_zip.sh 1.0.1";
	exit -1;
fi

FILES="zencat_sqlite.dll zencat_sqlite.xml"

# pack x86 release files:

BINDIR=Release

if [ ! -d $BINDIR ]; then
	echo "$BINDIR output directory missing."
	exit -1;
fi

CPU=x86
TYPE=release

ZIPFILE="zencat_sqlite_binaries_$1_$CPU_$TYPE.zip"

if [ -f "$ZIPFILE" ]; then
	echo "removing old $ZIPFILE";
	rm "$ZIPFILE";
fi

pushd $BINDIR
zip ../$ZIPFILE $FILES
popd


# pack x86 release files:

BINDIR=Debug

if [ ! -d $BINDIR ]; then
	echo "$BINDIR output directory missing."
	exit -1;
fi

CPU=x86
TYPE=debug

ZIPFILE="zencat_sqlite_binaries_$1_$CPU_$TYPE.zip"

if [ -f "$ZIPFILE" ]; then
	echo "removing old $ZIPFILE";
	rm "$ZIPFILE";
fi

pushd $BINDIR
zip ../$ZIPFILE $FILES
popd



